﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Zocono.Infrastructure.Common
{
    public class ApiBase
    {
        public static  HeaderResult<T> Success<T>(string message)
        {
            HeaderResult<T> headerResult = new HeaderResult<T>();
            headerResult.IsSucceed = true;
            headerResult.StatusCode = "200";
            headerResult.Message = message;
            return headerResult;
        }

        public static HeaderResult<T> Success<T>(T result, string message)
        {
            HeaderResult<T> headerResult = new HeaderResult<T>();
            headerResult.IsSucceed = true;
            headerResult.StatusCode = "200";
            headerResult.Result = result;
            headerResult.Message = message;
            return headerResult;
        }

        public static HeaderResult<T> Error<T>(string message)
        {
            HeaderResult<T> headerResult = new HeaderResult<T>();
            headerResult.IsSucceed = false;
            headerResult.StatusCode = "200";
            headerResult.Message = message;
            return headerResult;
        }

        public static HeaderResult<T> Info<T>(T result,int total)
        {
            HeaderResult<T> headerResult = new HeaderResult<T>();
            headerResult.IsSucceed = true;
            headerResult.StatusCode = "200";
            headerResult.Result = result;
            headerResult.Total = total;
            return headerResult;
        }

        public static HeaderResult<T> Info<T>(T result, int total, string message)
        {
            HeaderResult<T> headerResult = new HeaderResult<T>();
            headerResult.IsSucceed = true;
            headerResult.StatusCode = "200";
            headerResult.Result = result;
            headerResult.Total = total;
            headerResult.Message = message;
            return headerResult;
        }




    }
}
